#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file https://www.gnu.org/licenses/gpl-3.0.txt

from pisi.actionsapi import shelltools, pisitools, get

shelltools.export("LIBSSH2_SYS_USE_PKG_CONFIG", "1")

def setup():
    shelltools.system("cargo fetch --locked")

def build():
    shelltools.system('cargo build --release')

def install():
    shelltools.system("cargo install --path . --root='%s'/usr" % get.installDIR())

    pisitools.remove("/usr/.crates.toml")
    pisitools.remove("/usr/.crates2.json")
